package com.iflytek.yly.jetpackdemo.lifecycle;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public class LifeCycleDemo1Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //初始化位置管理器
        LocationManager.getInstance().initLocationManager();
    }

    @Override
    protected void onResume() {
        super.onResume();
        //开始获取用户的地理位置
        LocationManager.getInstance().startGetLocation();
    }

    @Override
    protected void onPause() {
        super.onPause();

        //停止获取用户的地理位置
        LocationManager.getInstance().stopGetLocation();
    }
}